#!/bin/bash
#
# Packs Pulley into pulley-pack-test.sh, which will be stored in the /tmp
# directory unless PULLEY_TEST_TEMP is set
#
# Author:   Dr. Mike Murphy (mmurphy2@coastal.edu)
# Revision: 20 November 2013
#
#   Copyright 2013 Coastal Carolina University
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#

[ -z "${PULLEY_TEST_TEMP}" ] && PULLEY_TEST_TEMP=/tmp
out="${PULLEY_TEST_TEMP}/pulley-pack-test.sh"


if [[ -z "${PULLEY_ROOT}" ]]; then
	myself=$(readlink -f "$0")
	whereami=$(dirname "${myself}")
	
	# Pulley root should be 2 directories up
	PULLEY_ROOT=$(dirname "${whereami}")
	PULLEY_ROOT=$(dirname "${PULLEY_ROOT}")
fi

cd "${PULLEY_ROOT}"
./build.sh "${out}"
